﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MarchEstate.Manager.BusinesEntity;
using MarchEstate.Manager.Dao.Costform;

namespace MarchEstate.Manager.ObjectModel.Costform
{
    public class Meter : AbstractMeter
    {
        private CostformDao formDao = null;

        public Meter()
        {

        }
        public override void InitDao()
        {
            base.InitDao();
            formDao = NewDao<CostformDao>();
        }

        public override bool Save()
        {
            if (MeterId == null)
                formDao.AddMeter(this);
            return true;
        }

        public override bool Delete(string _meterId)
        {
            return formDao.DeleteMeter(_meterId);
        }

        public override List<AbstractMeter> GetMeterList(int _meterType, int _meterType2)
        {
            return formDao.GetMeterList(_meterType, _meterType2);
        }

        public override List<AbstractMeter> GetMeterList(int _meterType, int _meterType2, CoreFrame.Core.Orm.PageInfo page)
        {
            return formDao.GetMeterList(_meterType, _meterType2, page);
        }

        public override List<AbstractMeter> GetMeterList(int _meterType, int _meterType2, string searchKey, CoreFrame.Core.Orm.PageInfo page)
        {
            return formDao.GetMeterList(_meterType, _meterType2, searchKey, page);
        }

        public override AbstractMeter GetMeter(string _meterId)
        {
            return formDao.GetMeter(_meterId);
        }

        public override List<AbstractMeter> GetAllMeterList(int _meterType, int _meterType2, CoreFrame.Core.Orm.PageInfo page)
        {
            return formDao.GetAllMeterList(_meterType, _meterType2, page);
        }

        public override List<AbstractMeter> GetAllMeterList(string _SrccId, CoreFrame.Core.Orm.PageInfo page)
        {
            return formDao.GetAllMeterList( _SrccId, page);
        }

        public override bool UpdateMeterInitNum(string _meterId, decimal _initNum)
        {
            return formDao.UpdateMeterInitNum(_meterId, _initNum);
        }
    }
}
